import request from "@/utils/request";
// let baseURL = "http://localhost:8080/";

// let baseUrl = 'http://10.168.1.213:8064'
// let baseUrl = 'http://10.168.1.123:8064'   //测试环境
// let baseUrl = 'http://10.168.1.222:8064'
let baseUrl = ''

// 列表
export function getWindPowerList(data) {
  return request({
    url: baseUrl+"/freq/stationInfo/queryEnergyStationInfo",
    method: "post",
    data: data || {},
  });
}

// 新增
export function addInsertEnergyStation(data) {
  return request({
    url: baseUrl + "/freq/stationInfo/insertOrUpdateEnergyStationInfo",
    method: "post",
    data: data || {},
  });
}

// 编辑
export function updateEnergyStation(data) {
  return request({
    url: baseUrl + "/freq/stationInfo/updateEnergyStationInfo",
    method: "post",
    data: data || {},
  });
}
// 删除
export function deleteEnergyStation(data) {
  return request({
    url: baseUrl + "/freq/stationInfo/deleteEnergyStationInfo",
    method: "post",
    data: data || {},
  });
}

// 导出
export function downloadEnergyStation(data) {
  return request({
    url: baseUrl + "/freq/stationInfo/downloadEnergyStationInfos",
    method: "post",
    data: data || {},
  });
}

// 列表的文件预览、下载
export function getPdf(data) {
  return request({
    url: baseUrl + `/freq/file/download1?fileId=`+ data,
    method: "get",
    responseType: "blob",
  });
}

// 导出信息检索
export function downloadCommonStationWin(data) {
  return request({
    url: baseUrl+"/freq/stationInfo/downloadEnergyStationInfos",
    method: "POST",
    responseType: "blob",
    data,
  });
}

//导出试验管理
export function downloadStationTestInfo(data) {
  return request({
    url: baseUrl+"/freq/stationInfo/downloadStationTestInfo",
    method: "POST",
    responseType: "blob",
    data,
  });
}

// 导出试验管理查询
export function downloadStationTestResultInfo(data) {
  return request({
    url: baseUrl+"/freq/stationInfo/downloadStationTestResultInfo",
    method: "POST",
    responseType: "blob",
    data,
  });
}
    // 删除接口
    export function deleteEnergyStationInfo(data) {
      return request({
        url:  baseUrl + "/freq/stationInfo/deleteEnergyStationInfo",
        method: "post",
        data:data || {}
      });
    }

    export function insertOrUpdateStationInfoFile(data) {
      return request({
        url: baseUrl + "/freq/stationInfo/insertOrUpdateStationInfoFile",
        method: "post",
        data: data || {},
      });
    }


    
// 列表
export function queryStationFileList(data) {
  return request({
    url: baseUrl+"/freq/stationInfo/queryStationFileList",
    method: "post",
    data: data || {},
  });
}

// 底部列表
export function queryStationPassRate(data) {
  return request({
    url: baseUrl+"/freq/stationInfo/stationPassRate",
    method: "post",
    data: data || {},
  });
}

//测试序号
export function queryStationTestNumber(data) {
  return request({
    url: baseUrl+"/freq/dict/queryStationTestNumbers",
    method: "post",
    data: data || {},
  });
}

//电厂已经审核通过的文件用这个接口
export function queryStationAuditedFiles(data) {
  return request({
    url: baseUrl+"/freq/dict/queryStationAuditedFiles",
    method: "post",
    data: data || {},
  });
}

//试验结果/方案删除
export function deleteStationFile(data) {
  return request({
    url: baseUrl + "/freq/stationInfo/deleteStationFile",
    method: "post",
    data: data || {},
  });
}


//试验结果/方案
export function insertOrUpdateStationInfoFileReport(data) {
  return request({
    url: baseUrl + "/freq/stationInfo/insertOrUpdateStationInfoFileReport",
    method: "post",
    data: data || {},
  });
}


export function insertStationInfoFile(data) {
  return request({
    url: baseUrl + "/freq/stationInfo/insertStationFile",
    method: "post",
    data: data || {},
  });
}

export function updateStationInfoFile(data) {
  return request({
    url: baseUrl + "/freq/stationInfo/updateStationFile",
    method: "post",
    data: data || {},
  });
}
